f = open(r"b.txt","w", encoding="utf-8") #encoding更改编码，解决输入中文乱码问题
s = ["京东\n","百度\n","头条\n"]
f.writelines(s)
f.close()